﻿<UserControl x:Class="myChannel9.Control_Tags"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    Loaded="UserControl_Loaded">

    <UserControl.Resources>
        <Style x:Key="PanoramaTextBlock" TargetType="TextBlock">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="35"/>
        </Style>

        <Style x:Key="PanoramaTextListBox" TargetType="ListBox">
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                    <TextBlock Text="{Binding Name}"
                                               Style="{StaticResource PanoramaTextBlock}"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <ListBox x:Name="lboTags" Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="400" SelectionChanged="lboTags_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="5">
                        <Grid Height="{ Binding BoxSize}"  Width="{ Binding BoxSize}" Background="White">
                            <TextBlock Text="{Binding BoxChar}" Foreground="#FF57B3C7" FontSize="40" Margin="10,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left"  Style="{StaticResource PanoramaTextBlock}" />
                        </Grid>
                        <TextBlock Text="{ Binding PresentTag}" TextWrapping="Wrap" VerticalAlignment="Center" Style="{StaticResource PanoramaTextBlock}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
